dfCan2015$Comp_FoUp[dfCan2015$PartyPref_FoUp==4 & dfCan2015$Q3B!=4 & dfCan2015$Q3B!=99] <- 2
dfCan2015$Comp_FoUp[dfCan2015$PartyPref_FoUp==5 & dfCan2015$Q3B!=5 & dfCan2015$Q3B!=99] <- 2
dfCan2015$Comp_FoUp <- as.factor(dfCan2015$Comp_FoUp)
levels(dfCan2015$Comp_FoUp) <- c("Preference is most Competent",
"No party Competent",
"Other party most Competent")
## The categories generated above are included in the final dummy that was used in the analyses:
# (Note: For the paper, I ultimately decided to use the dummy variable because the paper did
# not focus on the role of attrativeness of alternative voting options. Hence, categories 2 and 3,
# were coded into a single category)
dfCan2015$Comp_FoUp_Dummy <- NA
dfCan2015$Comp_FoUp_Dummy[dfCan2015$Comp_FoUp=="Preference is most Competent"] <- 0
dfCan2015$Comp_FoUp_Dummy[dfCan2015$Comp_FoUp=="No party Competent"] <- 1
dfCan2015$Comp_FoUp_Dummy[dfCan2015$Comp_FoUp=="Other party most Competent"] <- 1
dfCan2015$Comp_FoUp_Dummy <- as.factor(dfCan2015$Comp_FoUp_Dummy)
levels(dfCan2015$Comp_FoUp_Dummy) <- c("Preference is most Competent",
"Preference is not most Competent")
table(dfCan2015$Comp_FoUp_Dummy)
# Note: The Ns should be the following:
# Preference is msot competent: 2,672
# Preference is not most competent: 1,466
############################################################/
#### /// 2.C  Data preparation - Covariates            ####
###########################################################/
###############################################################################################/
#### >>> OutcomeImportance: Importance of Election Results (Constituency Level)             ####
###############################################################################################/
# Measures how important the election outcome at the constituency level is to respondents:
## Generate variable: importance of election outcome in riding
#(0=don't care at all; 10=care a lot)
dfCan2015$OutcomeImportance <- dfCan2015$Q26
#recode don't knows into NA
dfCan2015$OutcomeImportance[dfCan2015$OutcomeImportance==99] <- NA
###############################################################################################/
#### >>> OutcomeImportance: Importance of Election Results (National Level)                ####
###############################################################################################/
# Measures how important the election outcome at the federal level is to respondents:
## Generate variable: importance of who forms government
#(0=don't care at all; 10=care a lot)
dfCan2015$OutcomeImportance_National <- dfCan2015$Q20
#recode don't knows into NA
dfCan2015$OutcomeImportance_National[dfCan2015$OutcomeImportance_National==99] <- NA
###############################################################################################/
#### >>> ExpCom_N: Expection Electoral Competition (Constituency Level)                     ####
###############################################################################################/
# Measures respondents' expected electoral competition at the constituency level:
## Generate Variable: Expected Closeness of the Election
dfCan2015$ExpCom_N <- NA
dfCan2015$ExpCom_N[dfCan2015$Q29==4] <- 3 # Very close
dfCan2015$ExpCom_N[dfCan2015$Q29==3] <- 2
dfCan2015$ExpCom_N[dfCan2015$Q29==2] <- 1
dfCan2015$ExpCom_N[dfCan2015$Q29==1] <- 0 # Not very close at all
###############################################################################################/
#### >>> ID_HighestRatedParty_FoUp: Identification with highest rated party                 ####
###############################################################################################/
# This variable measures whether or not respondents report to identify with the party they rate
# as their most preferred party. Categories:
# 0=not identifying with highest rated party
# 1=identifying with highest rated party):
dfCan2015$ID_HighestRatedParty_FoUp <- 0
dfCan2015$ID_HighestRatedParty_FoUp[dfCan2015$PartyPref_FoUp==1 &
dfCan2015$Q47_1==1] <- 1
dfCan2015$ID_HighestRatedParty_FoUp[dfCan2015$PartyPref_FoUp==2 &
dfCan2015$Q47_1==2] <- 1
dfCan2015$ID_HighestRatedParty_FoUp[dfCan2015$PartyPref_FoUp==3 &
dfCan2015$Q47_1==3] <- 1
dfCan2015$ID_HighestRatedParty_FoUp[dfCan2015$PartyPref_FoUp==4 &
dfCan2015$Q47_1==4] <- 1
dfCan2015$ID_HighestRatedParty_FoUp[dfCan2015$PartyPref_FoUp==5 &
dfCan2015$Q47_1==5] <- 1
dfCan2015$ID_HighestRatedParty_FoUp <- as.factor(dfCan2015$ID_HighestRatedParty_FoUp)
table(dfCan2015$ID_HighestRatedParty_FoUp)
# Ns should be:
# 0=3,845
# 1=1,764
###############################################################################################/
#### >>> PrefTypeFoUp: Which party is respondent's most preferred                          ####
###############################################################################################/
# Variable is a categorical variable that captures which of the parties is the respondent's
# most preferred party. The variable was used in one of the robustness checks.
##Generate: Most Preferred Party is the following:
# 1 = Conservative Party
# 2 = New Democratic Party
# 3 = Liberal Party
# 4 = Bloc Quebecois
# 5 = Green Party
#Ties in preferences are broken using follow up question:
dfCan2015$PrefTypeFoUp <- NA
dfCan2015$PrefTypeFoUp[dfCan2015$PartyPref_FoUp==1] <- 1
dfCan2015$PrefTypeFoUp[dfCan2015$PartyPref_FoUp==2] <- 2
dfCan2015$PrefTypeFoUp[dfCan2015$PartyPref_FoUp==3] <- 3
dfCan2015$PrefTypeFoUp[dfCan2015$PartyPref_FoUp==4] <- 4
dfCan2015$PrefTypeFoUp[dfCan2015$PartyPref_FoUp==5] <- 5
#Turn into factor variable and add labels:
dfCan2015$PrefTypeFoUp <- as.factor(dfCan2015$PrefTypeFoUp)
levels(dfCan2015$PrefTypeFoUp) <- c("Conservative Part", "New Democratic Party",
"Liberal Party", "Bloc Québécois",
"Green Party")
###############################################################################################/
#### >>> LeaderPartyPref_CongruenceCat_FoUp: Leader Rating                                 ####
###############################################################################################/
## Variables measures how respondents' rate their most preferred parties' leaders: ##
# 0 = Leader of most preferred party is either rated as highest leader or among the highest rated leaders
#     (in case of ties)
# 1 = Favorite leader is NOT leader of most preferred party
# The five leaders are:
#Stephen Harper (Conservative Party; Q19_1)
#Thomas Mulcair (NDP, Q19_2)
#Justin Trudeau (LP, Q19_3)
#Gilles Duceppe (BQ, Q19_4)
#Elizabeth May (Green Party, Q19_5)
# Recode Missings (98=Don't know the leader; 99=Don't know) for party ratings:
#Stephen Harper (Conservative Party):
dfCan2015$Q19_1[dfCan2015$Q19_1>11] <- NA
#Thomas Mulcair (NDP):
dfCan2015$Q19_2[dfCan2015$Q19_2>11] <- NA
#Justin Trudeau (LP):
dfCan2015$Q19_3[dfCan2015$Q19_3>11] <- NA
#Gilles Duceppe (BC):
dfCan2015$Q19_4[dfCan2015$Q19_4>11] <- NA
#Elizabeth May (Green Party):
dfCan2015$Q19_5[dfCan2015$Q19_5>11] <- NA
# Identify column numbers for leader ratings:
which( colnames(dfCan2015)=="Q19_1" )
which( colnames(dfCan2015)=="Q19_5" )
## Identify highest rated leader (ties are broken randomly - will be recoded further below):
dfCan2015$LeaderPref_string <- NA
dfCan2015$LeaderPref_string <- max.col(replace(dfCan2015[11:15], is.na(dfCan2015[11:15]), -Inf), ties.method="random")
dfCan2015$LeaderPref_string <- dfCan2015$LeaderPref_string * NA^!rowSums(!is.na(dfCan2015[11:15]))
## Generate Variable: Maxmimum Rating of highest rated leader
#http://r.789695.n4.nabble.com/Calculating-a-Maximum-for-a-row-or-column-with-NA-s-td2014630.html
dfCan2015$LeaderPref_Max <- NA
dfCan2015$LeaderPref_Max<-apply(dfCan2015[11:15],1,max, na.rm=TRUE)
dfCan2015$LeaderPref_Max[dfCan2015$LeaderPref_Max=="-Inf"] <- NA
table(dfCan2015$LeaderPref_Max)
## Generate Variable for respondents who are NA for rating variables of ALL leaders:
dfCan2015$LeaderLikeDislike_NA_Only <- apply(dfCan2015[,11:15], 1, function(x) all(is.na(x)))
## Identify cases in which respondents did not have a peak preference but rated at least two leaders equally:
dfCan2015$Dupl_Leader <- NA
dfCan2015$Dupl_Leader <- ifelse(dfCan2015$LeaderPref_Max==dfCan2015$Q19_1 &
dfCan2015$Q19_1==dfCan2015$Q19_2  &
!is.na(dfCan2015$Q19_1) & !is.na(dfCan2015$Q19_2)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_1 &
dfCan2015$Q19_1==dfCan2015$Q19_3  &
!is.na(dfCan2015$Q19_1) & !is.na(dfCan2015$Q19_3)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_1 &
dfCan2015$Q19_1==dfCan2015$Q19_4  &
!is.na(dfCan2015$Q19_1) & !is.na(dfCan2015$Q19_4)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_1 &
dfCan2015$Q19_1==dfCan2015$Q19_5  &
!is.na(dfCan2015$Q19_1) & !is.na(dfCan2015$Q19_5),
1, dfCan2015$Dupl_Leader)
dfCan2015$Dupl_Leader <- ifelse(dfCan2015$LeaderPref_Max==dfCan2015$Q19_2 &
dfCan2015$Q19_2==dfCan2015$Q19_1  &
!is.na(dfCan2015$Q19_2) & !is.na(dfCan2015$Q19_1)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_2 &
dfCan2015$Q19_2==dfCan2015$Q19_3  &
!is.na(dfCan2015$Q19_2) & !is.na(dfCan2015$Q19_3)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_2 &
dfCan2015$Q19_2==dfCan2015$Q19_4  &
!is.na(dfCan2015$Q19_2) & !is.na(dfCan2015$Q19_4)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_2 &
dfCan2015$Q19_2==dfCan2015$Q19_5  &
!is.na(dfCan2015$Q19_2) & !is.na(dfCan2015$Q19_5),
1, dfCan2015$Dupl_Leader)
dfCan2015$Dupl_Leader <- ifelse(dfCan2015$LeaderPref_Max==dfCan2015$Q19_3 &
dfCan2015$Q19_3==dfCan2015$Q19_1  &
!is.na(dfCan2015$Q19_3) & !is.na(dfCan2015$Q19_1)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_3 &
dfCan2015$Q19_3==dfCan2015$Q19_2  &
!is.na(dfCan2015$Q19_3) & !is.na(dfCan2015$Q19_2)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_3 &
dfCan2015$Q19_3==dfCan2015$Q19_4  &
!is.na(dfCan2015$Q19_3) & !is.na(dfCan2015$Q19_4)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_3 &
dfCan2015$Q19_3==dfCan2015$Q19_5  &
!is.na(dfCan2015$Q19_3) & !is.na(dfCan2015$Q19_5),
1, dfCan2015$Dupl_Leader)
dfCan2015$Dupl_Leader <- ifelse(dfCan2015$LeaderPref_Max==dfCan2015$Q19_4 &
dfCan2015$Q19_4==dfCan2015$Q19_1  &
!is.na(dfCan2015$Q19_4) & !is.na(dfCan2015$Q19_1)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_4 &
dfCan2015$Q19_4==dfCan2015$Q19_2  &
!is.na(dfCan2015$Q19_4) & !is.na(dfCan2015$Q19_2)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_4 &
dfCan2015$Q19_4==dfCan2015$Q19_3  &
!is.na(dfCan2015$Q19_4) & !is.na(dfCan2015$Q19_3)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_4 &
dfCan2015$Q19_4==dfCan2015$Q19_5  &
!is.na(dfCan2015$Q19_4) & !is.na(dfCan2015$Q19_5),
1, dfCan2015$Dupl_Leader)
dfCan2015$Dupl_Leader <- ifelse(dfCan2015$LeaderPref_Max==dfCan2015$Q19_5 &
dfCan2015$Q19_5==dfCan2015$Q19_1  &
!is.na(dfCan2015$Q19_5) & !is.na(dfCan2015$Q19_1)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_5 &
dfCan2015$Q19_5==dfCan2015$Q19_2  &
!is.na(dfCan2015$Q19_5) & !is.na(dfCan2015$Q19_2)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_5 &
dfCan2015$Q19_5==dfCan2015$Q19_3  &
!is.na(dfCan2015$Q19_5) & !is.na(dfCan2015$Q19_3)|
dfCan2015$LeaderPref_Max==dfCan2015$Q19_5 &
dfCan2015$Q19_5==dfCan2015$Q19_4  &
!is.na(dfCan2015$Q19_5) & !is.na(dfCan2015$Q19_4),
1, dfCan2015$Dupl_Leader)
# Recode all cases in which respondents did not evaluate a single leader to NA:
dfCan2015$Dupl_Leader[dfCan2015$LeaderLikeDislike_NA_Only=="TRUE"] <- NA
# Generate PartyPref_Random with codes for highest rated party (1="party 1",
#2="party 2" etc.):
dfCan2015$LeaderPref_Random <- NA
dfCan2015$LeaderPref_Random[dfCan2015$LeaderPref_string==1] <- 1
dfCan2015$LeaderPref_Random[dfCan2015$LeaderPref_string==2] <- 2
dfCan2015$LeaderPref_Random[dfCan2015$LeaderPref_string==3] <- 3
dfCan2015$LeaderPref_Random[dfCan2015$LeaderPref_string==4] <- 4
dfCan2015$LeaderPref_Random[dfCan2015$LeaderPref_string==5] <- 5
# Generate LeaderPartyPref_CongruenceCat_FoUp with codes for highest rated party (1="party 1",
#2="party 2" etc.) and code "9. TIED LEADER RATING"
dfCan2015$LeaderPref <- dfCan2015$LeaderPref_Random
dfCan2015$LeaderPref[dfCan2015$Dupl_Leader==1] <- 9
# Ties in max leader ratings are coded in third category, codes
#   0. Most preferred leader is leader of most preferred party (MAX Leader Ratings tied)
#   1. Most preferred leader is NOT leader of most preferred party
dfCan2015$LeaderPartyPref_CongruenceCat_FoUp <- NA
dfCan2015$LeaderPartyPref_CongruenceCat_FoUp <- ifelse(dfCan2015$LeaderPref==dfCan2015$PartyPref_FoUp,0,1)
dfCan2015$LeaderPartyPref_CongruenceCat_FoUp[dfCan2015$LeaderPref==9] <- 0
dfCan2015$LeaderPartyPref_CongruenceCat_FoUp <- as.factor(dfCan2015$LeaderPartyPref_CongruenceCat_FoUp)
###############################################################################################/
#### >>> LocalLeader_Congruence_FoUp: Local Leader Rating                                 ####
###############################################################################################/
## Local Leader Congruence with Party Rating (for all four party ID versions):
# 0= Favorite Local Leader is from preferred party/No Favorite Local Leader
# 1= Favorite Local Leader is NOT from preferred party
# Set Missings:
dfCan2015$Q27[dfCan2015$Q27==9] <- NA #DK to missing
dfCan2015$Q27[dfCan2015$Q27A==99] <- NA #DK to missing
dfCan2015$LocalLeader_Congruence_FoUp <- NA
dfCan2015$LocalLeader_Congruence_FoUp[dfCan2015$PartyPref_FoUp==dfCan2015$Q27A] <- 0
dfCan2015$LocalLeader_Congruence_FoUp[dfCan2015$PartyPref_FoUp!=dfCan2015$Q27A] <- 1
dfCan2015$LocalLeader_Congruence_FoUp[dfCan2015$Q27==2] <- 0
dfCan2015$LocalLeader_Congruence_FoUp <- as.factor(dfCan2015$LocalLeader_Congruence_FoUp)
###############################################################################################/
#### >>> Demographics: Education, Age, Gender, Province                                   ####
###############################################################################################/
##Education (Dummy for Postsecondary Education):
dfCan2015$Edu <- dfCan2015$POSTSECONDARY
##Age (Year of election minus Year of Birth)
dfCan2015$Age <- dfCan2015$age
##Gender (Male=0, Female=1)
dfCan2015$Gender <- NA
dfCan2015$Gender[dfCan2015$gend==1] <- 0
dfCan2015$Gender[dfCan2015$gend==2] <- 1
dfCan2015$Gender <- as.factor(dfCan2015$Gender)
levels(dfCan2015$Gender) <- c("Male", "Female")
##Province Categorical Variable (1=BC, 2=Ontario, 3=Quebec)-. Factor variable,
## levels are assigned.
dfCan2015$Province <- NA
dfCan2015$Province[dfCan2015$ELECID==1] <- 1
dfCan2015$Province[dfCan2015$ELECID==2] <- 2
dfCan2015$Province[dfCan2015$ELECID==3] <- 3
dfCan2015$Province <- as.factor(dfCan2015$Province)
levels(dfCan2015$Province) <- c("Quebec",
"British Columbia",
"Ontario")
######################## END OF RSCRIPT #######################/
#############################################################################/
#### Part 3 - Analayses (Descriptives, Main Analyses, Robustness Checks) ####
############################################################################/
# Note: a helpful source to generate the figures was the following:
# http://bradleyboehmke.github.io/tutorials/barchart (Last accessed: July 1, 2019)
# Before getting into the analyses, I subset the dataset as described in the main text
# (see section "Research Strategy"; abstainers are also excluded - see paper for more information):
df_PrevVote <- dfCan2015[which(dfCan2015$SD9==dfCan2015$PartyPref_FoUp &
dfCan2015$NonSince_FoUp!="2"),]
#############################################################################/
#### /// 3A: Descriptive Statistics                                       ####
#############################################################################/
#### >>> Table A10.1 (Supplementary Material) ####
# Descriptive Stats of all relevant variables:
# is renamned and its levels are renmaned, too, for plotting
# purposes (i.e., the plots of the interaction terms):
names(df_PrevVote)[names(df_PrevVote) == "Comp_FoUp_Dummy"] <- "Competence"
levels(df_PrevVote$Competence) <- c("Most competent", "Not most competent")
#names(df_PrevVote)[names(df_PrevVote) == "Comp_FoUp_Dummy"] <- "Competence"
#levels(df_PrevVote$Competence) <- c("Most competent", ": Not most competent")
#df_PrevVote$ExpCom_N <- as.numeric(df_PrevVote$ExpCom)
#df_PrevVote$ExpCom_N <- 4-df_PrevVote$ExpCom_N
#### >>> Basic Model (without covariates; not included in the paper ####
Logit_2 <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp +
Competence +
WinChaPref_Relative+
ExpCom_N +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote)
summary(Logit_2)
Logit_2A <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp*WinChaPref_Relative +
Competence +
ExpCom_N +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote)
summary(Logit_2A)
intplot2A <- interplot(m = Logit_2A, var1 = "IdeoDis_FoUp", var2 = "WinChaPref_Relative", hist = T,
adjCI = TRUE) +
theme_bw() +
geom_hline(yintercept = 0, linetype = "dashed")+
xlab("Perceived chances of preferred \n party to win constituency")+
ylab("Marginal effect of ideological \n incongruence on insincere voting")+
ggtitle("2.1- Ideological incongruence*Win \n chance")+
scale_x_continuous(labels=c("0.00" = "0. None", "0.25" = "0.25", "0.50" = "0.50",
"0.75" = "0.75", "1.00" = "1. High"))
intplot2A
Logit_2C <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp*ExpCom_N+
Competence +
WinChaPref_Relative +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote)
summary(Logit_2C)
Logit_2D <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp+
Competence*ExpCom_N +
WinChaPref_Relative +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote)
summary(Logit_2D)
intplot2D <- interplot(m = Logit_2D, var1 = "Competence", var2 = "ExpCom_N", hist = T,
adjCI = TRUE) +
theme_bw() +
geom_hline(yintercept = 0, linetype = "dashed")+
xlab("Perceived, expected electoral \n competition in constituency")+
ylab("Marginal effect of party \n incompetence on insincere voting")+
ggtitle("3.2- Party incompetence*Electoral \n competition")+
scale_x_continuous(labels=c("0" = "0. Low", "1" = "1", "2" = "2",
"3" = "4. High"))
intplot2D
# is renamned and its levels are renmaned, too, for plotting
# purposes (i.e., the plots of the interaction terms):
names(df_PrevVote)[names(df_PrevVote) == "Comp_FoUp_Dummy"] <- "Competence"
levels(df_PrevVote$Competence) <- c("Most competent", ": Not most competent")
Logit_2D <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp+
Competence*ExpCom_N +
WinChaPref_Relative +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote)
summary(Logit_2D)
interplot(m = Logit_2D, var1 = "Competence", var2 = "ExpCom_N", hist = T,
adjCI = TRUE) +
theme_bw() +
geom_hline(yintercept = 0, linetype = "dashed")+
xlab("Perceived, expected electoral \n competition in constituency")+
ylab("Marginal effect of party \n incompetence on insincere voting")+
ggtitle("3.2- Party incompetence*Electoral \n competition")+
scale_x_continuous(labels=c("0" = "0. Low", "1" = "1", "2" = "2",
"3" = "4. High"))
Logit_RBC1_A <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp +
Competence +
WinChaPref_Relative+
ExpCom_N +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote[df_PrevVote$PartyPref_FoUp!=1,])
summary(Logit_RBC1_A)
Logit_RBC1_B <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp +
Competence +
WinChaPref_Relative+
ExpCom_N +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote[df_PrevVote$PartyPref_FoUp!=2,])
summary(Logit_RBC1_B)
Logit_RBC1_C <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp +
Competence +
WinChaPref_Relative+
ExpCom_N +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote[df_PrevVote$PartyPref_FoUp!=3,])
summary(Logit_RBC1_C)
Logit_RBC1_D <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp +
Competence +
WinChaPref_Relative+
ExpCom_N +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote[df_PrevVote$PartyPref_FoUp!=4,])
summary(Logit_RBC1_D)
Logit_RBC1_E <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp +
Competence +
WinChaPref_Relative+
ExpCom_N +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote[df_PrevVote$PartyPref_FoUp!=5,])
summary(Logit_RBC1_E)
Logit_RBC1_F <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp +
Competence +
PrefTypeFoUp +
WinChaPref_Relative+
ExpCom_N +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=df_PrevVote)
summary(Logit_RBC1_F)
Summary.Data_Sec2H <- df_PrevVote %>%
group_by(NonSince_FoUp_Dum) %>%
summarise(mean=mean(PartyPref_Max, na.rm=TRUE),
median=median(PartyPref_Max, na.rm=TRUE),
sd=sd(PartyPref_Max, na.rm=TRUE),
min=min(PartyPref_Max, na.rm=TRUE),
max=max(PartyPref_Max, na.rm=TRUE))
Summary.Data_Sec2H #lets look at the output
dfCan2015_RBC2 <- dfCan2015[dfCan2015$NonSince_FoUp!=2,]
names(dfCan2015_RBC2)[names(dfCan2015_RBC2) == "Comp_FoUp_Dummy"] <- "Competence"
levels(dfCan2015_RBC2$Competence) <- c("Most competent", ": Not most competent")
Logit_RBC2_1 <- glm(NonSince_FoUp_Dum ~ IdeoDis_FoUp + Competence,
family = "binomial",
data=dfCan2015_RBC2)
summary(Logit_RBC2_1)
Logit_RBC2_2 <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp +
Competence +
WinChaPref_Relative+
ExpCom_N +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=dfCan2015_RBC2)
summary(Logit_RBC2_2)
Logit_RBC2_2D <- glm(NonSince_FoUp_Dum ~
IdeoDis_FoUp+
Competence*ExpCom_N +
WinChaPref_Relative +
OutcomeImportance +
OutcomeImportance_National +
ID_HighestRatedParty_FoUp +
LocalLeader_Congruence_FoUp +
LeaderPartyPref_CongruenceCat_FoUp +
Gender + Age + Edu + Province,
family = "binomial",
data=dfCan2015_RBC2)
summary(Logit_RBC2_2D)
